package service.Impl;

import dao.DoctorfeeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Doctorfee;
import service.DoctorfeeService;

import java.util.List;

@Service
public class DoctorfeeServiceImpl implements DoctorfeeService {

    @Autowired
    private DoctorfeeDao doctorfeeDao;

    @Override
    public int insertDoctorfee(Doctorfee doctorfee) {
        // 可以添加业务逻辑，如检查费用名称是否已存在
        return doctorfeeDao.insertDoctorfee(doctorfee);
    }

    @Override
    public int deleteDoctorfeeById(Integer feeId) {
        // 可以添加业务逻辑，如检查是否有医生使用该费用项目
        return doctorfeeDao.deleteDoctorfeeById(feeId);
    }

    @Override
    public int updateDoctorfee(Doctorfee doctorfee) {
        // 可以添加业务逻辑，如更新时自动设置更新时间
        doctorfee.setUpdateTime(new java.util.Date());
        return doctorfeeDao.updateDoctorfee(doctorfee);
    }

    @Override
    public Doctorfee selectDoctorfeeById(Integer feeId) {
        return doctorfeeDao.selectDoctorfeeById(feeId);
    }

    @Override
    public List<Doctorfee> selectAllDoctorfees() {
        return doctorfeeDao.selectAllDoctorfees();
    }

    @Override
    public List<Doctorfee> selectDoctorfeesByStatus(Integer status) {
        return doctorfeeDao.selectDoctorfeesByStatus(status);
    }
    @Override
    public List<java.util.Map<String, Object>> selectFeeInfoByDoctorId(String doctorId) {
        return doctorfeeDao.selectFeeInfoByDoctorId(doctorId);
    }
}